#include <iostream>
#include <stdio.h>
#include <algorithm>
#include <cstring>
using namespace std;
typedef long long ll;
const ll MOD=1000007;
const ll MAXN=505;
ll C[MAXN][MAXN];
void Init() {
	memset(C, 0, sizeof(C));
	C[0][0]=1;
	for (int i=1; i<MAXN; ++i) {
		C[i][0]=C[i][i]=1;
		for (int j=1; j<i; ++j) {
			C[i][j]=(C[i-1][j-1]+C[i-1][j])%MOD;
		}
	}
}
int main() {
	Init();
	int T;
	cin>>T;
	ll m,n,k;
	ll r,c,cnt;
	for (int Cas=1; Cas<=T; ++Cas) {
		scanf("%lld%lld%lld", &m, &n, &k);
		ll ans=0;
		for (int S=0; S<16; ++S) {
			r=m; c=n; cnt=0;
			if (S&1) {
				r--;
				cnt++;
			}
			if (S&2) {
				r--;
				cnt++;
			}
			if (S&4) {
				c--;
				cnt++;
			}
			if (S&8) {
				c--;
				cnt++;
			}
			if (cnt&1) {
				ans=(ans+MOD-C[r*c][k])%MOD;
			}
			else {
				ans=(ans+C[r*c][k])%MOD;
			}
		}
		printf("Case %d: %lld\n", Cas, ans);
	}
	return 0;
} 
